package com.mijie.homi.ns.dao;

import java.util.HashMap;

import org.springframework.stereotype.Repository;

import com.mijie.core.IBatisDao;
import com.mijie.homi.common.domain.chat.ChatMessage;

@Repository
public class ChatMessageDao extends IBatisDao{

	public int saveChatMessage(ChatMessage message){
		return this.insert("saveChatMessage", message);
	}
	
	public int deleteChatMessage(String[] array){
		return this.delete("deleteChatMessage", array);
	}
	
	public boolean blockingMessage(int userId,int intruder){
		HashMap<String,Object> parameter = new HashMap<String,Object>();
		parameter.put("userId", userId);
		parameter.put("intruder", intruder);
		return this.selectInteger("blockingMessage", parameter)!=null;
	}
	
}
